package com.itheima.controller;


import com.itheima.pojo.Books;
import com.itheima.pojo.Enterprise;
import com.sun.media.sound.SoftTuning;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/books")

public class BookController {

//    @Value("${enterprise.name}")
//    private String name;

//    @Value("${enterprise.age}")
//    private Integer age;

//    @Value("${enterprise.tell}")
//    private String tell;


//    /* 环境*/
//    @Autowired
//    private Environment environment;


//    /*pojo封装    用的较多*/

//    @Autowired
//    private Enterprise enterprise;

//    @Autowired
    private Books books;




    @GetMapping("/{id}")
    public String books(@PathVariable Integer id) {

        System.out.println(" id == " + id);

//        System.out.println("----------1---------------");
//        System.out.println(name +'\t'+ age+'\t' + tell);

//        System.out.println("----------2---------------");
//        System.out.println(environment.getProperty("enterprise.name"));
//        System.out.println("----------3---------------");
//        System.out.println(enterprise);

//        System.out.println("___________________4_________________");
//        System.out.println(books);

        return "Hello World  " + id;
    }

}
